import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '/index',
    //   component: resolve => require(['@/components/index/index.vue'], resolve),
    // },
    {
      path: '/',
      component: resolve => require(['@/components/home.vue'], resolve),
      children: [
        {
          path: '/userManagement',
          component: resolve => require(['@/components/management/userManagement.vue'], resolve)
        },
        {
          path: '/userManagement/openUp',
          component: resolve => require(['@/components/management/openUp.vue'], resolve)
        },
        {
          path: '/walletManagement',
          component: resolve => require(['@/components/management/walletManagement.vue'], resolve)
        },
        {
          path: '/walletManagement/createRecharge',
          component: resolve => require(['@/components/management/createRecharge.vue'], resolve)
        },
      ]
    },
    {
      path: '/login',
      component: resolve => require(['@/components/index/login.vue'], resolve),
    },
    {
      path: '/pay',
      name: 'pay',
      component: resolve => require(['@/components/management/pay.vue'], resolve)
    },
  ]
})
